package com.sibu.yx.promotion.admin.web.controller.excel;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sibu.yx.promotion.persistence.request.ExportDemoRequest;
import com.sibu.yx.promotion.persistence.response.ExportDemoResponse;
import com.sibu.yx.promotion.service.impl.excel.ExportDemoServiceImpl;
import com.sibu.yx.promotion.persistence.vo.ExportInfoVo;


/**
 * @author suzheng
 * @date 2020-06-17
 **/
@Controller
@RequestMapping("/export")
public class ExcelExportController extends AbstractExportBaseController {


    @Autowired
    private ExportDemoServiceImpl<ExportDemoRequest> exportDemoService;

    /**
     * 导出数据
     * @param response
     * @param request
     * @throws IOException
     */
    @GetMapping("/exportDemo")
    public void exportMemberCreditDetailList(HttpServletResponse response, @Valid ExportDemoRequest request)
            throws IOException {
        ExportInfoVo<ExportDemoResponse> exportInfoVo = new ExportInfoVo<>();
        exportInfoVo.setOutFileName("demo");
        exportInfoVo.setDataClass(ExportDemoResponse.class);
        super.returnExportResponse(response, request, exportInfoVo, exportDemoService);
    }
}
